package Demo01.Demo03;

import java.util.Random;

public class TestHandler {
    public static void main(String[] args) {
        Randommethod(new RandomNumHandler() {
            @Override
            public int gonumber() {
                Random r = new Random();
                int num = r.nextInt(10)+1;
                return num;
            }
        });
        Randommethod(new RandomNumHandler() {
            @Override
            public int gonumber() {
                Random r2 = new Random();
                int num2 = r2.nextInt(50)+1;
                return num2;
            }
        });

    }

    public static void Randommethod(RandomNumHandler RNH){
       int number =  RNH.gonumber();
        System.out.println(number);
    }
}


